﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QunYing.BLL
{

    public partial class LeaveMsg
    {
        private readonly QunYing.DAL.LeaveMsg dal = new QunYing.DAL.LeaveMsg();
        public LeaveMsg()
        { 

        }
        #region method
        /// <summary>
        /// 留言
        /// </summary>
        public int Add(QunYing.Model.LeaveMsg model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 获取留言
        /// </summary>
        /// <param name="strID"></param>
        /// <returns></returns>
        public DataTable GetMsg(string strID)
        {
            return dal.GetMsg(strID);
        }
        /// <summary>
        /// 经销商获取留言信息
        /// </summary>
        /// <param name="strID">经销商编号</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="strState">是否已回复</param>
        /// <param name="isDealer">是否经销商</param>
        /// <returns></returns>
        public DataTable GetMsgByDealer(string DealerID, DateTime startDate, DateTime endDate, string strState,string strType,string isDealer)
        {
            return dal.GetMsgByDealer(DealerID, startDate, endDate, strState, strType, isDealer);
        }

        /// <summary>
        /// 回复留言
        /// </summary>
        /// <param name="ID">留言的自增ID</param>
        /// <param name="content">回复内容</param>
        /// <param name="DealerID">经销商编号</param>
        /// <returns></returns>
        public bool ReplyMsg(string ID, string DealerID, string content)
        {
            return dal.ReplyMsg(ID, DealerID, content);
        }
        /// <summary>
        /// 删除留言
        /// </summary>
        /// <param name="ID">留言的自增ID</param>
        /// <returns></returns>
        public bool DelMsg(string ID)
        {
            return dal.DelMsg(ID);
        }

        //  /// <summary>
        ///// 最新未回复留言
        ///// </summary>
        ///// <param name="DealerID"></param>
        ///// <param name="top"></param>
        ///// <returns></returns>
        //public DataTable getNewMsg(string DealerID, int top)
        //{
        //    return dal.getNewMsg(DealerID, top);
        //}

         /// <summary>
        /// 留言统计
        /// </summary>
        /// <param name="DealerID"></param>
        /// <returns></returns>
        public DataSet QueryTotalMsg(string DealerID, DateTime startDate, DateTime endDate)
         {
             return dal.QueryTotalMsg(DealerID, startDate, endDate);
         }

        #endregion
    }
}
